package com.tx.review.inner;

/**
 * 局部内部类
 */
public class LocalClassDemo {
    public static void main(String[] args) {
        Man man = new Man();
        People people = man.getPeople();
        System.out.println(people);
    }
}


class People{
    public People() {
        System.out.println("people");
    }
}

class Man{

    public Man() {
        System.out.println("man");
    }

    public People getPeople(){

        //局部内部类，类名不能有public等修饰
        class Woman extends People{
            public Woman() {
                System.out.println("woman");
            }
        }

        return new Woman();

    }
}